package com.cy.pj.goods.service;

import com.cy.pj.goods.dao.GoodsDao;
import com.cy.pj.goods.dao.GoodsDaoImpl;
import com.cy.pj.goods.pojo.Goods;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-03 16:20
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    private static final Logger log = LoggerFactory.getLogger(GoodsDaoImpl.class);

    @Autowired
    private GoodsDao goodsDao;

    @Override
    public List<Goods> findGoods() {
        long start = System.currentTimeMillis();
        List<Goods> goods = goodsDao.findGoods();
        long end = System.currentTimeMillis();
        log.info("findGoods()->end-start={}",end-start);/* 输出日志 */
        return goods;
    }

}
